package com.ourteam.product.model.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Tue Nov 07 10:29:34 IRKT 2017
 * Auto Generate Date : 2017-11-15 14:52:26
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class ProductModelPropertyRelateBean implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.Id);

        mappedDaoFields.put("relateCode",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelateCode);

        mappedDaoFields.put("relateName",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelateName);

        mappedDaoFields.put("propertyId",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.PropertyId);

        mappedDaoFields.put("relatedPropertyId",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelatedPropertyId);

        mappedDaoFields.put("relatedType",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelatedType);

        mappedDaoFields.put("relatedConfig",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelatedConfig);

        mappedDaoFields.put("sortIndex",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.SortIndex);

        mappedDaoFields.put("status",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.Status);

        mappedDaoFields.put("remarks",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.Remarks);

        mappedDaoFields.put("relatedPropertyName",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelatedPropertyName);

        mappedDaoFields.put("relatedPropertyDataType",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelatedPropertyDataType);

        mappedDaoFields.put("relatedPropertyDataTypeId",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelatedPropertyDataTypeId);

        mappedDaoFields.put("relatedPropertyDataLength",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelatedPropertyDataLength);

        mappedDaoFields.put("relatedPropertyDataAccuracy",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelatedPropertyDataAccuracy);

        mappedDaoFields.put("relatedPropertyIsAllowNull",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelatedPropertyIsAllowNull);

        mappedDaoFields.put("relatedPropertyisPrimaryKey",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelatedPropertyisPrimaryKey);

        mappedDaoFields.put("relatedPropertyIsAutoInc",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelatedPropertyIsAutoInc);

        mappedDaoFields.put("relatedPropertyObjectId",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelatedPropertyObjectId);

        mappedDaoFields.put("relatedPropertyObjectName",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelatedPropertyObjectName);

        mappedDaoFields.put("objectRelateId",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.ObjectRelatedId);

        mappedDaoFields.put("propertyName",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.PropertyName);

        mappedDaoFields.put("propertyDataType",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.PropertyDataType);

        mappedDaoFields.put("propertyObjectId",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.PropertyObjectId);

        mappedDaoFields.put("propertyObjectType",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.PropertyObjectType);

        mappedDaoFields.put("propertyObjectName",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.PropertyObjectName);

        mappedDaoFields.put("relatedPropertyObjectType",
            com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelatedPropertyObjectType);
    }

    private com.ourteam.product.model.dao.ProductModelPropertyRelate productModelPropertyRelate;

    public ProductModelPropertyRelateBean() {
        super();

        this.productModelPropertyRelate = new com.ourteam.product.model.dao.ProductModelPropertyRelate();
    }

    public ProductModelPropertyRelateBean(
        com.ourteam.product.model.dao.ProductModelPropertyRelate productModelPropertyRelate) {
        super();

        this.productModelPropertyRelate = productModelPropertyRelate;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(productModelPropertyRelate);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.product.model.dao.ProductModelPropertyRelate convertToProductModelPropertyRelate() {
        return this.productModelPropertyRelate;
    }

    public com.ourteam.product.model.dao.ProductModelPropertyRelate convertTo() {
        return this.productModelPropertyRelate;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.productModelPropertyRelate.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.productModelPropertyRelate.setId(id);
    }

    /**
     * Get relateCode
     *
     * @return String
     */
    public String getRelateCode() {
        return (String) this.productModelPropertyRelate.getRelateCode();
    }

    /**
     * Set relateCode
     *
     * @parameter String
     */
    public void setRelateCode(String relateCode) {
        this.productModelPropertyRelate.setRelateCode(relateCode);
    }

    /**
     * Get relateName
     *
     * @return String
     */
    public String getRelateName() {
        return (String) this.productModelPropertyRelate.getRelateName();
    }

    /**
     * Set relateName
     *
     * @parameter String
     */
    public void setRelateName(String relateName) {
        this.productModelPropertyRelate.setRelateName(relateName);
    }

    /**
     * Get propertyId
     *
     * @return long
     */
    public long getPropertyId() {
        return (long) this.productModelPropertyRelate.getPropertyId();
    }

    /**
     * Set propertyId
     *
     * @parameter long
     */
    public void setPropertyId(long propertyId) {
        this.productModelPropertyRelate.setPropertyId(propertyId);
    }

    /**
     * Get relatedPropertyId
     *
     * @return long
     */
    public long getRelatedPropertyId() {
        return (long) this.productModelPropertyRelate.getRelatedPropertyId();
    }

    /**
     * Set relatedPropertyId
     *
     * @parameter long
     */
    public void setRelatedPropertyId(long relatedPropertyId) {
        this.productModelPropertyRelate.setRelatedPropertyId(relatedPropertyId);
    }

    /**
     * Get relatedType
     *
     * @return String
     */
    public String getRelatedType() {
        return (String) this.productModelPropertyRelate.getRelatedType();
    }

    /**
     * Set relatedType
     *
     * @parameter String
     */
    public void setRelatedType(String relatedType) {
        this.productModelPropertyRelate.setRelatedType(relatedType);
    }

    /**
     * Get relatedConfig
     *
     * @return String
     */
    public String getRelatedConfig() {
        return (String) this.productModelPropertyRelate.getRelatedConfig();
    }

    /**
     * Set relatedConfig
     *
     * @parameter String
     */
    public void setRelatedConfig(String relatedConfig) {
        this.productModelPropertyRelate.setRelatedConfig(relatedConfig);
    }

    /**
     * Get sortIndex
     *
     * @return int
     */
    public int getSortIndex() {
        return (int) this.productModelPropertyRelate.getSortIndex();
    }

    /**
     * Set sortIndex
     *
     * @parameter int
     */
    public void setSortIndex(int sortIndex) {
        this.productModelPropertyRelate.setSortIndex(sortIndex);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.productModelPropertyRelate.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.productModelPropertyRelate.setStatus(status);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.productModelPropertyRelate.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.productModelPropertyRelate.setRemarks(remarks);
    }

    /**
     * Get relatedPropertyName
     *
     * @return String
     */
    public String getRelatedPropertyName() {
        return (String) this.productModelPropertyRelate.getRelatedPropertyName();
    }

    /**
     * Get relatedPropertyDataType
     *
     * @return String
     */
    public String getRelatedPropertyDataType() {
        return (String) this.productModelPropertyRelate.getRelatedPropertyDataType();
    }

    /**
     * Get relatedPropertyDataTypeId
     *
     * @return long
     */
    public long getRelatedPropertyDataTypeId() {
        return (long) this.productModelPropertyRelate.getRelatedPropertyDataTypeId();
    }

    /**
     * Get relatedPropertyDataLength
     *
     * @return int
     */
    public int getRelatedPropertyDataLength() {
        return (int) this.productModelPropertyRelate.getRelatedPropertyDataLength();
    }

    /**
     * Get relatedPropertyDataAccuracy
     *
     * @return int
     */
    public int getRelatedPropertyDataAccuracy() {
        return (int) this.productModelPropertyRelate.getRelatedPropertyDataAccuracy();
    }

    /**
     * Get relatedPropertyIsAllowNull
     *
     * @return String
     */
    public String getRelatedPropertyIsAllowNull() {
        return (String) this.productModelPropertyRelate.getRelatedPropertyIsAllowNull();
    }

    /**
     * Get relatedPropertyisPrimaryKey
     *
     * @return String
     */
    public String getRelatedPropertyisPrimaryKey() {
        return (String) this.productModelPropertyRelate.getRelatedPropertyisPrimaryKey();
    }

    /**
     * Get relatedPropertyIsAutoInc
     *
     * @return String
     */
    public String getRelatedPropertyIsAutoInc() {
        return (String) this.productModelPropertyRelate.getRelatedPropertyIsAutoInc();
    }

    /**
     * Get relatedPropertyObjectId
     *
     * @return long
     */
    public long getRelatedPropertyObjectId() {
        return (long) this.productModelPropertyRelate.getRelatedPropertyObjectId();
    }

    /**
     * Get relatedPropertyObjectName
     *
     * @return String
     */
    public String getRelatedPropertyObjectName() {
        return (String) this.productModelPropertyRelate.getRelatedPropertyObjectName();
    }

    /**
     * Get objectRelateId
     *
     * @return long
     */
    public long getObjectRelateId() {
        return (long) this.productModelPropertyRelate.getObjectRelatedId();
    }

    /**
     * Set objectRelateId
     *
     * @parameter long
     */
    public void setObjectRelateId(long objectRelateId) {
        this.productModelPropertyRelate.setObjectRelatedId(objectRelateId);
    }

    /**
     * Get propertyName
     *
     * @return String
     */
    public String getPropertyName() {
        return (String) this.productModelPropertyRelate.getPropertyName();
    }

    /**
     * Get propertyDataType
     *
     * @return String
     */
    public String getPropertyDataType() {
        return (String) this.productModelPropertyRelate.getPropertyDataType();
    }

    /**
     * Get propertyObjectId
     *
     * @return long
     */
    public long getPropertyObjectId() {
        return (long) this.productModelPropertyRelate.getPropertyObjectId();
    }

    /**
     * Get propertyObjectType
     *
     * @return String
     */
    public String getPropertyObjectType() {
        return (String) this.productModelPropertyRelate.getPropertyObjectType();
    }

    /**
     * Get propertyObjectName
     *
     * @return String
     */
    public String getPropertyObjectName() {
        return (String) this.productModelPropertyRelate.getPropertyObjectName();
    }

    /**
     * Get relatedPropertyObjectType
     *
     * @return String
     */
    public String getRelatedPropertyObjectType() {
        return (String) this.productModelPropertyRelate.getRelatedPropertyObjectType();
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof ProductModelPropertyRelateBean) == false) {
            return false;
        } // end if

        ProductModelPropertyRelateBean other = (ProductModelPropertyRelateBean) obj;

        boolean isEqual = false;

        com.ourteam.product.model.dao.ProductModelPropertyRelate tempProductModelPropertyRelate =
            other.convertToProductModelPropertyRelate();

        if ((tempProductModelPropertyRelate == null) ||
                (this.productModelPropertyRelate == null)) {
            isEqual = false;
        } else if ((tempProductModelPropertyRelate == this.productModelPropertyRelate) ||
                tempProductModelPropertyRelate.equals(
                    this.productModelPropertyRelate)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static ProductModelPropertyRelateBean[] toArray(
        com.ourteam.product.model.dao.ProductModelPropertyRelate[] aProductModelPropertyRelates) {
        return toArray(aProductModelPropertyRelates, null);
    }

    public static ProductModelPropertyRelateBean[] toArray(
        com.ourteam.product.model.dao.ProductModelPropertyRelate[] aProductModelPropertyRelates,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aProductModelPropertyRelates)) {
            return new ProductModelPropertyRelateBean[0];
        }

        int length = aProductModelPropertyRelates.length;

        ProductModelPropertyRelateBean[] beans = new ProductModelPropertyRelateBean[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new ProductModelPropertyRelateBean(aProductModelPropertyRelates[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aProductModelPropertyRelates[i] });
            }
        }

        return beans;
    }
}
